import Vue from "vue";
import Vuex from "vuex";
// 状态持久化插件
import createPersistedState from "vuex-persistedstate";
Vue.use(Vuex);
export default {
	modules: {},
	plugins: [createPersistedState({
		key: "uniapp-tuan",
		// 通过paths指定需要保存的数据
		storage: {
			getItem: (key) => {
				// console.log("getItem",key);
				return uni.getStorageSync(key)
			},
			setItem: (key, value) => {
				// console.log("setItem", key);
				return uni.setStorageSync(key, value)
			},
			removeItem: (key) => uni.removeStorageSync(key)
		},
	})]
}
